package com.sinochem.yunlian.ship.common.enums;

import lombok.Data;
import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

import java.util.Arrays;
import java.util.List;

/**
 * 动态类型
 */
public enum ShipDynamicStatus {

    JG("0","进港"),
    LG("1", "离港"),
    KB("2", "靠泊"),
    LB("3","离泊");

    @Getter
    private String nodeCode;

    @Getter
    private String name;

    ShipDynamicStatus(String nodeCode, String name){
        this.nodeCode = nodeCode;
        this.name = name;
    }



    public static String getCodeByName(String name) {
        for (ShipDynamicStatus item : ShipDynamicStatus.values()) {
            if (StringUtils.equals(name, item.name)) {
                return item.nodeCode;
            }
        }
        return null;
    }
}
